<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/favicon.ico">
    <link rel="icon" type="image/png" href="./assets/img/favicon.ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>Anchor Bootstrap 4.1.3 UI Kit by WowThemesNet</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport'/>

    <!-- Google Font -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:300,300i,400,600,800" rel="stylesheet">

    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

    <!-- Main CSS -->
    <link href="./assets/css/main.css" rel="stylesheet"/>

    <!-- Animation CSS -->
    <link href="./assets/css/vendor/aos.css" rel="stylesheet"/>

</head>

<body>

<!------------------------------------------
NAVBAR:不用改
------------------------------------------->

<!------------------------------------------
HEADER
------------------------------------------->
<div class="jumbotron jumbotron-lg jumbotron-fluid mb-3 bg-primary position-relative">
    <div class="container text-white h-100 tofront">
        <div class="row align-items-center justify-content-center text-center">
            <div class="col-md-10">
                <!-- thymeleaf语法:渲染文章题目 -->
                <h1>MongoDB-2 安装与配置</h1>
            </div>
        </div>
    </div>
</div>



<div class="container  pt-5 pb-5" data-aos="fade-up">
    <div class="row justify-content-center">
        <div class="col-md-8 mt-20">
            <article>
                <!-- 此处渲染标题 -->
                <h1><strong>Bold title</strong> for your paragraph</h1>
<!--                <p th:text="${article.content}">Welcome to BeiJing!</p>-->
                <tbody>
                    <td><h3 id="安装建议" style="font-size: 16px; font-weight: bold; line-height: 1.5; margin-top: 10px; margin-right: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-family: 微软雅黑, 宋体, Arial;">安装建议</h3><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;">MongoDB 可以在mac/win/linux上安装，我个人建议在linux上安装会更好，这样测试起来更方便。一般来说本地只装mysql或者MariaDB，其余的中间件一律放linux，让电脑软件解耦，毕竟你的电脑不是一直处于工作状态，有时候也是用于娱乐的~</p><h3 id="安装步骤" style="font-size: 16px; font-weight: bold; line-height: 1.5; margin-top: 10px; margin-right: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-family: 微软雅黑, 宋体, Arial;">安装步骤</h3><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;">打开官网：<a href="https://www.mongodb.com/download-center/community" style="color: rgb(70, 70, 70);">https://www.mongodb.com/download-center/community</a></li><li style="list-style-type: disc;">选择版本进行下载，在这里就以linux为安装演示</li><li style="list-style-type: disc;">需要注意，4.0.16包含linux 64位版本下载，而4.2.3中暂未包含，当然你要选择其他的linux版本下载也可以，另外最新的4.3.3位开发版，不建议使用<br><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123603443-1273425369.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%;"></li><li style="list-style-type: disc;">下载好后，上传到linux中，如下：</li></ul><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123603717-390247619.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">解压缩：</p><pre style="margin-top: 10px; white-space: pre-wrap;"><code class="hljs css" style="line-height: 1.5 !important; margin: auto; vertical-align: middle; display: block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) !important; padding: 5px !important; border-radius: 3px !important; height: auto; overflow-x: auto; color: rgb(0, 0, 0);"><span class="hljs-selector-tag" style="color: rgb(0, 0, 255);">tar</span> <span class="hljs-selector-tag" style="color: rgb(0, 0, 255);">-zxvf</span> <span class="hljs-selector-tag" style="color: rgb(0, 0, 255);">mongodb-linux-x86_64-4</span><span class="hljs-selector-class">.0</span><span class="hljs-selector-class">.16</span><span class="hljs-selector-class">.tgz</span>
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">得到：</p></li></ul><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123604217-486556759.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">重命名解压缩后的文件夹并且移动到&nbsp;<code style="line-height: 1.8; margin: 1px 5px; vertical-align: middle; display: inline-block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; padding: 0px 5px !important; border-radius: 3px !important;">/usr/local</code>&nbsp;中：</p><pre style="margin-top: 10px; white-space: pre-wrap;"><code class="hljs lua" style="line-height: 1.5 !important; margin: auto; vertical-align: middle; display: block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) !important; padding: 5px !important; border-radius: 3px !important; height: auto; overflow-x: auto; color: rgb(0, 0, 0);">mv mongodb-linux-x86_64<span class="hljs-number">-4.0</span><span class="hljs-number">.16</span> /usr/<span class="hljs-keyword" style="color: rgb(0, 0, 255);">local</span>/mongodb
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123604500-1486530451.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123604746-1204938508.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">使其生效：</p><pre style="margin-top: 10px; white-space: pre-wrap;"><code class="hljs r" style="line-height: 1.5 !important; margin: auto; vertical-align: middle; display: block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) !important; padding: 5px !important; border-radius: 3px !important; height: auto; overflow-x: auto; color: rgb(0, 0, 0);"><span class="hljs-keyword" style="color: rgb(0, 0, 255);">source</span> /etc/profile
</code></pre></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">查看MongoDB版本：</p><pre style="margin-top: 10px; white-space: pre-wrap;"><code class="hljs nginx" style="line-height: 1.5 !important; margin: auto; vertical-align: middle; display: block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) !important; padding: 5px !important; border-radius: 3px !important; height: auto; overflow-x: auto; color: rgb(0, 0, 0);"><span class="hljs-attribute" style="color: rgb(163, 21, 21);">mongo</span> -version
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123604974-1939025354.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p></li></ul><h3 id="配置mongodb" style="font-size: 16px; font-weight: bold; line-height: 1.5; margin-top: 10px; margin-right: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-family: 微软雅黑, 宋体, Arial;">配置MongoDB</h3><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">在MongoDB根目录中创建 data/db 目录，用于存储数据库文件数据，并且再创建 data/logs/mongodb.log 用于存储日志</p><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123605194-1276211592.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123605512-1516942620.jpg" alt="file" loading="lazy" style="height: auto; max-width: 100%; margin: 10px;"></p></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">在mongodb根目录下创建核心配置文件，并且追加配置内容如下：</p></li></ul><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;"><pre style="margin-top: 10px; white-space: pre-wrap;"><code class="hljs nginx" style="line-height: 1.5 !important; margin: auto; vertical-align: middle; display: block; font-family: &quot;Courier New&quot;, sans-serif !important; font-size: 12px !important; background: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204) !important; padding: 5px !important; border-radius: 3px !important; height: auto; overflow-x: auto; color: rgb(0, 0, 0);"><span class="hljs-attribute" style="color: rgb(163, 21, 21);">mongod</span> -f mongodb.conf<img src="https://img2018.cnblogs.com/blog/841496/202002/841496-20200214123607005-2038946580.jpg" alt="file" loading="lazy" style="font-family: 微软雅黑, 宋体, Arial; font-size: 15px; height: auto; max-width: 100%; margin: 10px;"></code></pre></li></ul></td>
                </tbody>
            </article>
        </div>
    </div>
</div>
<!-- End Main -->
<!--------------------------------------
JAVASCRIPTS:不用改
--------------------------------------->
<!-- CDN 引入vue 和 axios -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="./assets/js/vendor/jquery.min.js" type="text/javascript"></script>
<script src="./assets/js/vendor/popper.min.js" type="text/javascript"></script>
<script src="./assets/js/vendor/bootstrap.min.js" type="text/javascript"></script>
<script src="./assets/js/functions.js" type="text/javascript"></script>

<!-- Animation -->
<script src="./assets/js/vendor/aos.js" type="text/javascript"></script>
<noscript>
    <style>
        *[data-aos] {
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
        }
    </style>
</noscript>
<script>
    AOS.init({
        duration: 700
    });
</script>

<script type="module">
    import { onMounted, ref } from 'vue'
    import request from '@/utils/request.js'
    defineProps({
        data: {
            type: Array,
            required: true
        }
    })
    //获取数据
    const blogs = ref([])
    const getData = async () => {
        let res = await request({
            url: '/article/2/1',
            method: 'GET'
            //data: { content: '好' }
        })
        console.log('res:', res)
        blogs.value = res.rows
        console.log('blogs', blogs)
    }

    onMounted(() => {
        getData(),
            console.log("'blogs', blogs")
    })
</script>

<!-- Disable animation on less than 1200px, change value if you like -->
<script>
    AOS.init({
        disable: function () {
            var maxWidth = 1200;
            return window.innerWidth < maxWidth;
        }
    });
    // $(document).ready(function () {
    //
    //     if(location.href.indexOf("#reloaded")==-1){
    //         location.href=location.href+"#reloaded";
    //         location.reload();
    //     }
    // })
    if (location.href.indexOf("#reloaded") == -1) {
        location.href = location.href + "#reloaded";
        location.reload();
    };
</script>

</body>
</html>